package com.uhylab.uhuvinetest.activity;

import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.uhylab.uhuvinetest.R;
import com.uhylab.uhuvinetest.adapter.UHHistory_Content_Adapter;
import com.uhylab.uhuvinetest.base.UHBaseActivity;
import com.uhylab.uhuvinetest.bean.History_Content;

import java.util.ArrayList;

/**
 * Created by xyb on 16/1/14 at UHylab
 *
 * @version 1.0
 */
public class UHHistoryActivity extends UHBaseActivity {
    private ImageView register_back;
    private ListView listView;
    private UHHistory_Content_Adapter uhHistory_content_adapter;
    private ArrayList<History_Content> arrayList;
    private String days[];
    private TextView text;
    private int [] weidong;
    private int [] liuming;


    @Override
    public int bindLayout() {
        return R.layout.activity_history;
    }

    @Override
    public void initView(View view) {
        Intent intent = getIntent();
        if (intent != null) {
            arrayList = intent.getParcelableArrayListExtra("content");
            weidong =    intent.getIntArrayExtra("weidong");
            liuming =    intent.getIntArrayExtra("liuming");
            days = intent.getStringArrayExtra("days");
        }
        register_back = (ImageView) view.findViewById(R.id.register_back);
        listView = (ListView) view.findViewById(R.id.history_list);
        text = (TextView) view.findViewById(R.id.text);
    }

    @Override
    public void doBusiness(Context mContext) {

        text.setText(days[0] + "" + days[1]);
        register_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        uhHistory_content_adapter = new UHHistory_Content_Adapter(this, arrayList,weidong,liuming);
        listView.setAdapter(uhHistory_content_adapter);
    }

    @Override
    public void resume() {

    }

    @Override
    public void destroy() {

    }

}
